from django.urls import path, re_path
from School import consumers  # 导入消费者


websocket_urlpatterns = [
    path('ws/some_url/', consumers.YourConsumer.as_asgi()),  # 自己的 WebSocket 路由
    re_path(r'ws/studentscount/(?P<id>[^/]+)/$', consumers.StudentCountConsumer.as_asgi()),
    re_path(r'ws/communication/(?P<username>[^/]+)/$', consumers.communicate.as_asgi()),  # 允许用户名参数
    re_path(r'ws/studentchat/(?P<nickname>[^/]+)/$', consumers.ChatConsumer.as_asgi()),  # 允许用户名参数
]


